home *** CD-ROM | disk | FTP | other *** search
- /*
- * fenv.h glue functions ...
- */
-
- #ifndef __SANE__
- #include <SANE.h>
- #endif
-
- #ifndef __FENV__
- #include <fenv.h>
- #endif
-
- #define unused(x) &x
-
- #if __MC68881__
-
- fenv_t _FE_DFL_ENV = {0,0};
-
- void feclearexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void fegetexcept ( fexcept_t */*flagp*/, int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void feraiseexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void fesetexcept ( const fexcept_t */*flagp*/, int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- int fetestexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- return 0;
- }
-
- int fegetround ( void )
- {
- return(GetRound());
- }
-
- int fesetround ( int round )
- {
- RoundDir rounddir=round;
-
- if ((rounddir == FE_TONEAREST) || (rounddir == FE_UPWARD) ||
- (rounddir == FE_DOWNWARD) || (rounddir == FE_TOWARDZERO))
- {
- SetRound(rounddir);
- return 1;
- }
- else
- return 0;
- }
-
- void fegetenv ( fenv_t */*envp*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- int feholdexcept ( fenv_t */*envp*/ )
- {
- /* NOT YET IMPLEMENTED */
- return 1;
- }
-
- void fesetenv ( const fenv_t */*envp*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void feupdateenv ( const fenv_t */*envp*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- int fegetprec ( void )
- {
- return((int)GetPrecision());
- }
-
- int fesetprec ( int precision )
- {
- RoundPre roundpre=precision;
-
- if ((roundpre == FE_FLTPREC) || (roundpre == FE_DBLPREC) ||
- (roundpre == FE_LDBLPREC))
- {
- SetPrecision(roundpre);
- return 1;
- }
- else
- return 0;
- }
-
- #else /* SANE */
-
- fenv_t _FE_DFL_ENV = 0;
-
- void feclearexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void fegetexcept ( fexcept_t */*flagp*/, int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void feraiseexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- void fesetexcept ( const fexcept_t */*flagp*/, int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- }
-
- int fetestexcept ( int /*excepts*/ )
- {
- /* NOT YET IMPLEMENTED */
- return 0;
- }
-
- int fegetround ( void )
- {
- return(GetRound());
- }
-
- int fesetround ( int round )
- {
- RoundDir rounddir=round;
-
- if ((rounddir == FE_TONEAREST) || (rounddir == FE_UPWARD) ||
- (rounddir == FE_DOWNWARD) || (rounddir == FE_TOWARDZERO))
- {
- SetRound(rounddir);
- return 1;
- }
- else
- return 0;
- }
-
- void fegetenv ( fenv_t *envp )
- {
- GetEnvironment(envp);
- }
-
- int feholdexcept ( fenv_t *envp )
- {
- fenv_t env;
-
- GetEnvironment(envp);
- env=*envp;
- env &= ~(FE_ALL_EXCEPT << 8);
- SetEnvironment(&env);
- return 1;
- }
-
- void fesetenv ( const fenv_t *envp )
- {
- SetEnvironment((fenv_t *)envp);
- }
-
- void feupdateenv ( const fenv_t * envp )
- {
- ProcExit((fenv_t *)envp);
- }
-
- int fegetprec ( void )
- {
- return((int)GetPrecision());
- }
-
- int fesetprec ( int precision )
- {
- RoundPre roundpre=precision;
-
- if ((roundpre == FE_FLTPREC) || (roundpre == FE_DBLPREC) ||
- (roundpre == FE_LDBLPREC))
- {
- SetPrecision(roundpre);
- return 1;
- }
- else
- return 0;
- }
-
- #endif
-